package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:30
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductDatabaseDataTypeMapBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductDatabaseDataTypeMapDAO.Id);

        mappedDaoFields.put("dataType",
            com.ourteam.product.model.dao.IProductDatabaseDataTypeMapDAO.DataType);

        mappedDaoFields.put("mappedDataType",
            com.ourteam.product.model.dao.IProductDatabaseDataTypeMapDAO.MappedDataType);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductDatabaseDataTypeMapDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductDatabaseDataTypeMapDAO.Remarks);
    }

    private com.ourteam.product.model.dao.ProductDatabaseDataTypeMap productDatabaseDataTypeMap;

    public ProductDatabaseDataTypeMapBean() {
        super();

        this.productDatabaseDataTypeMap = new com.ourteam.product.model.dao.ProductDatabaseDataTypeMap();
    }

    public ProductDatabaseDataTypeMapBean(
        com.ourteam.product.model.dao.ProductDatabaseDataTypeMap productDatabaseDataTypeMap) {
        super();

        this.productDatabaseDataTypeMap = productDatabaseDataTypeMap;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productDatabaseDataTypeMap);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductDatabaseDataTypeMap convertToProductDatabaseDataTypeMap() {
        return this.productDatabaseDataTypeMap;
    }

    public com.ourteam.product.model.dao.ProductDatabaseDataTypeMap convertTo() {
        return this.productDatabaseDataTypeMap;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productDatabaseDataTypeMap.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productDatabaseDataTypeMap.setId(id);
    }

    /**
     * Get dataType
     *
     * @return String
     */
    public String getDataType() {
        return (String) this.productDatabaseDataTypeMap.getDataType();
    }

    /**
     * Set dataType
     *
     * @parameter String
     */
    public void setDataType(String dataType) {
        this.productDatabaseDataTypeMap.setDataType(dataType);
    }

    /**
     * Get mappedDataType
     *
     * @return String
     */
    public String getMappedDataType() {
        return (String) this.productDatabaseDataTypeMap.getMappedDataType();
    }

    /**
     * Set mappedDataType
     *
     * @parameter String
     */
    public void setMappedDataType(String mappedDataType) {
        this.productDatabaseDataTypeMap.setMappedDataType(mappedDataType);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productDatabaseDataTypeMap.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productDatabaseDataTypeMap.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productDatabaseDataTypeMap.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productDatabaseDataTypeMap.setRemarks(remarks);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductDatabaseDataTypeMapBean) == false) {
            return false;
        } // end if

        ProductDatabaseDataTypeMapBean other = (ProductDatabaseDataTypeMapBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductDatabaseDataTypeMap tempProductDatabaseDataTypeMap =
            other.convertToProductDatabaseDataTypeMap();

        if ((tempProductDatabaseDataTypeMap == null) ||
                (this.productDatabaseDataTypeMap == null)) {
            isEqual = false;
        } else if ((tempProductDatabaseDataTypeMap == this.productDatabaseDataTypeMap) ||
                tempProductDatabaseDataTypeMap.equals(
                    this.productDatabaseDataTypeMap)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductDatabaseDataTypeMapBean[] toArray(
        com.ourteam.product.model.dao.ProductDatabaseDataTypeMap[] aProductDatabaseDataTypeMaps) {
        return toArray(aProductDatabaseDataTypeMaps, null);
    }

    public static ProductDatabaseDataTypeMapBean[] toArray(
        com.ourteam.product.model.dao.ProductDatabaseDataTypeMap[] aProductDatabaseDataTypeMaps,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductDatabaseDataTypeMaps)) {
            return new ProductDatabaseDataTypeMapBean[0];
        }

        int length = aProductDatabaseDataTypeMaps.length;

        ProductDatabaseDataTypeMapBean[] beans = new ProductDatabaseDataTypeMapBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductDatabaseDataTypeMapBean(aProductDatabaseDataTypeMaps[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductDatabaseDataTypeMaps[i] });
            }
        }

        return beans;
    }
}
